package com.mall.service.order.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mall.model.domain.OmsOrderSetting;
import com.mall.service.order.mapper.OmsOrderSettingMapper;
import com.mall.service.order.service.OmsOrderSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OmsOrderSettingServiceImpl extends ServiceImpl<OmsOrderSettingMapper, OmsOrderSetting> implements OmsOrderSettingService {
    @Autowired
    private OmsOrderSettingMapper omsOrderSettingMapper;

    @Override
    public void updateOmsOrderSetting(Long id, OmsOrderSetting omsOrderSetting) {
        LambdaQueryWrapper<OmsOrderSetting> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(OmsOrderSetting::getId, id);
        omsOrderSettingMapper.update(omsOrderSetting,queryWrapper);
    }

    @Override
    public OmsOrderSetting findById(Long id) {
        OmsOrderSetting orderSetting = omsOrderSettingMapper.selectById(id);
        return orderSetting;
    }
}
